# 9. 给定一个列表，里面包含一批纯数字，按从小到大对其进行排序
# 冒泡排序
# list = [2,43,54,3,24,54,64,24,56,22,34,5]
# for i in range(0,len(list)-1):
#     for j in range(0,len(list)-i-1):
#         if list[j] > list[j+1]:
#             a = list[j]
#             list[j] = list[j+1]
#             list[j+1] = a
# print(list)

# 选择排序
list = [2,43,54,3,24,64,24,56,22,34,5]
m = len(list)
for j in range(0,m-1):
    a = list[0]
    c = 0
    for i in range(0,m-j):
        if a < list[i]:
            a = list[i]
            c = i
    b = list[m-j-1]
    list[m-j-1] = list[c]
    list[c] = b
print(list)
